//
//  SSafe.h
//  安全类
//
//  Created by BrightLi on 2016/12/22.
//  Copyright © 2021年 TJZ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define SSafeIsiOS(version) ([[UIDevice currentDevice].systemVersion floatValue] >= version)

typedef void(^SSafeLog)(NSString *,NSString *,NSString *);

@interface MyAssertHandler : NSAssertionHandler
@end

@interface YMSafeUtil:NSObject

@property(nonatomic,copy) SSafeLog block;

// 交换类方法
+ (void) swizzleClass:(Class) klass
            sel1:(SEL)sel1
            sel2:(SEL)sel2;
// 交换实例方法
+ (void) swizzleInstance:(Class) klass
            sel1:(SEL)sel1
            sel2:(SEL)sel2;
// 单例
+(instancetype) shared;
// 输出到日志
+ (void) log:(NSString *)format,... NS_FORMAT_FUNCTION(1,2);
// 异常堆栈
+ (void) stackLog:(NSException *) exception start:(int) start;
// 修正闪退
+ (void) fixed;
// 更安全的主线程检查
+ (BOOL) isMainQueue;

@end


